SRC = addr.cpp loader.cpp rdiff.cpp rloader.cpp
BIN = $(SRC:.cpp=)
DEP = $(SRC:.cpp=.d)
INC = -I../../include -I. -I../include
CFLAGS = -std=c++0x $(INC) -g -Wall -fpermissive

all: depend utils

utils: $(addprefix bin/,$(BIN))

depend: $(addprefix dep/,$(DEP))
	
bin/% : %.cpp
	@mkdir -p bin
	g++ $(CFLAGS) $< -o $@

dep/%.d : %.cpp
	@mkdir -p dep
	g++ $(CFLAGS) $< -MM -MF $@ -MT bin/$*

clean:
	@rm -rf bin dep

#if use relative path strange things occures...
-include $(CURDIR)/dep/*